<template>
<div>
    <Table :loading="countData.loading" border :columns="columns2" :data="fcDataList" size="small">
        <template slot="action" slot-scope="{ row }">
            <Button class="table-action-btn" type="info" size="small" @click="showdetail(row, 'info')">详情</Button>
        </template>
    </Table>
</div>
</template>

<script>
import { getRecordZSList } from '@/api/record'
export default {
  name: 'index',
  props: {
    recordId: String
  },
  data () {
    return {
      row: {},
      countData: { loading: true },
      params: { record_id: [] },
      columns2: [
        { title: '档案号', key: 'recode_no', width: 150, align: 'center' },
        { title: '姓名', key: 'name', width: 170, align: 'center' },
        { title: '身份证号', key: 'idcard', width: 160, align: 'center' },
        { title: '性别', key: 'sex', width: 140, align: 'center' },
        { title: '机构编号', key: 'company_code', width: 100, align: 'left' },
        { title: '档案交接号', key: 'manager_recode_no', width: 100, align: 'left' },
        { title: '操作', align: 'center', width: 250, slot: 'action', fixed: 'right' }
      ],
      fcDataList: [],
      x: []
    }
  },
  methods: {

    selectlist () {
      this.getList()
    },
    getList () {
      getRecordZSList(this.params).then(res => {
        if (res.data.errcode === 0 || res.data.errcode === 1001) {
          this.fcDataList = res.data.data
          this.countData.loading = false
        }
      })
    },
    showdetail (row, what) {
      this.$router.push({ path: '/record/add', query: { id: row.id, what: what } })
    }
  },
  watch: {
    recordId (recordId) {
      let y = recordId
      this.x = y.split(',')
      this.params.record_id = this.$common.xeUtils.clone(this.x)
    }
  }
}
</script>

<style scoped>

</style>
